﻿//#include <iostream>
//// 标记一个函数为弃用
//[[deprecated]]void old_function();
//// 可以提供一条自定义的警告信息 
//[[deprecated("Use the new_function() instead, which is safer and faster.")]]void legacy_function();
//// 也可以标记类、类型别名、变量等 
//[[deprecated]]typedef char* CString;
//struct [[deprecated]] OldStruct {};
//
//[[deprecated]]int obsolete_variable;
//[[deprecated("This function is prone to errors. Use calculate() instead.")]]
//int compute() {return 42;}
//
//// deprecated也可以用于类型、变量、枚举等 
//// v1.0
//[[deprecated("这是v1.0版本，请使用v2.0改用connect(url, options)")]]
//void connect(std::string url){}
//// v2.0
//void connect(std::string url, int options){}
//
//int main() {
//	int x = compute(); // 编译时会产生警告或错误 
//	std::cout << x << std::endl;
//	CString ptr = nullptr;//	connect("https://en.cppreference.com/w/cpp/language/attributes.html");
//	return 0;
//}